<template>
  <div class='site-footer' :style="{background: isHome ? 'var(--h-bg)':'none'}">
  <!--  新增开始  -->
    <FooterTop></FooterTop>
  <!--  新增结束  -->
    <div class='footer'>
      <div class='footer-main'>
        <div class='flex footer-link'>
        <span v-if="websiteConfig.gonganBeianNumber != '' && websiteConfig.gonganBeianNumber != undefined"
              class='footer-item'>
          <a :href="'https://www.beian.gov.cn/portal/registerSystemInfo?recordcode='+websiteConfig.gonganBeianNumber"
             target='_blank' role='button'>
            <img src='https://www.qiaoxiao.top/static/images/gongan.png' style='float:left;' alt='公安备案' />
            <span> {{ websiteConfig.gonganBeianNumber }} </span>
          </a>
        </span>
          <span v-if="websiteConfig.beianNumber != '' && websiteConfig.beianNumber != undefined" class='footer-item'>
          <a href='https://beian.miit.gov.cn/' target='_blank' role='button'>
            <img src='https://www.qiaoxiao.top/static/images/icp.png' style='float:left;' alt='ICP备案' />
            <span> {{ websiteConfig.beianNumber }} </span>
          </a>
        </span>
          <span class='footer-item' title='阿里云提供储存服务'>
          <a href='https://www.aliyun.com/' role='button'>
            <img src='https://img.alicdn.com/tfs/TB13DzOjXP7gK0jSZFjXXc5aXXa-212-48.png' alt='阿里云'>
          </a>
        </span>
          <span class='footer-item' title='腾讯云提供CDN加速服务'>
          <a href='https://cloud.tencent.com/' role='button'>
            <img src='@/assets/svg/txy.svg' alt='腾讯云'>
          </a>
        </span>
        </div>
        <div class='flex footer-info'>
          <b class='footer-b'>{{ websiteConfig.author }}</b>版权所有· 基于<b class='footer-b'>{{ Site.frame }}</b>框架开发
        </div>
      </div>
    </div>
  </div>
</template>

<script lang='ts'>
import { computed, defineComponent } from 'vue'
import { useAppStore } from '@/stores/app'
import { useI18n } from 'vue-i18n'
import FooterTop from '@/components/FooterTop/FooterTop.vue'
import { useRoute } from 'vue-router'
import { Site } from '@/config/config'

export default defineComponent({
  name: 'Footer',
  components: { FooterTop },
  setup() {
    const appStore = useAppStore()
    const { t } = useI18n()
    const route = useRoute();
    return {
      websiteConfig: computed(() => appStore.websiteConfig),
      t,
      isHome: computed(()=>{
        return route.path.includes('/article') || route.path.includes('/agreement') || route.path.includes('/talks/')
      }),
      Site
    }
  }
})
</script>
<style>
.footer-item a,.footer-info{
    color: hsl(var(--font-color-hsl) / var(--font-color-alpha));
    text-decoration: none;
    outline: 0;
    transition: .7s;
}
body:where(.theme-light) {
    color: #0c0e10;
}
body:where(.theme-dark) {
    color: #ffffff;
}
.site-footer{
    display: block;
    position: relative;
    overflow: hidden;
    margin-inline: auto;
    backdrop-filter: none;
    background: var(--h-bg);
}
.footer {
    background: var(--h-bg);
    padding: 1.8rem 3.5rem;
    box-shadow: var(--box-shadow);
}

.footer-main {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--gap-divs);
    font-family: var(--top-font-family);
}
@media (max-width: 1152px) {
    .footer{
        padding: 1rem 1rem;
    }
    .footer-main{
        display: flex;
        flex-direction: column;
        gap: var(--gap-divs);
    }
}
.footer-info {
    opacity: .5;
}

.footer-info:before {
    content: "\e6b5";
    font-family: 'iconfont';
    margin: 0 0.25em 0 0;
}

.footer-link {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-content: center;
}

.footer-item a {
    filter: grayscale(1) opacity(.5);
    display: flex;
    flex-wrap: nowrap;
    flex-direction: row;
    align-items: center;
    white-space: nowrap;
    gap: 0 0.3em;
    line-height: 1;
}

.footer-item a:hover {
    filter: grayscale(0) opacity(1);
    color: rgb(var(--color-rgb));
    opacity: 1 !important;
}

.footer-item img {
    width: auto;
    height: 0.8rem;
    border-radius: 3px;
}
.footer-b:hover{
    color: rgb(var(--color-rgb)/0.8);
}
</style>
